package com.azier.kapacitor.script.node;

import com.azier.kapacitor.script.method.*;
import com.azier.kapacitor.script.node.nodebind.*;
import com.azier.kapacitor.script.node.nodebind.qlnodebind.*;

import java.util.ArrayList;

/**
* 1 * @Author: luoj
* 2 * @Date: 2019/11/8 11:27
* 3
*/

/**
Create a new Barrier node that emits a BarrierMessage periodically
**/

/**
创建一个新的Barrier节点，该节点定期发出BarrierMessage
**/
public class KapacitorLoopbackNode extends AbstractNode implements AlertNodeBind, BarrierNodeBind, BottomNodeBind, ChangeDetectNodeBind, CombineNodeBind, CountNodeBind, CumulativeSumNodeBind,
        DefaultNodeBind, DeleteNodeBind, DerivativeNodeBind, DifferenceNodeBind, DistinctNodeBind, Ec2AutoscaleNodeBind, ElapsedNodeBind, EvalNodeBind,
        FirstNodeBind, FlattenNodeBind, GroupByNodeBind, HoltWintersNodeBind, HoltWintersWithFitNodeBind, HttpOutNodeBind, HttpPostNodeBind,
        InfluxDBOutNodeBind, JoinNodeBind, K8sAutoscaleNodeBind, KapacitorLoopbackNodeBind, LastNodeBind, LogNodeBind, MeanNodeBind, MedianNodeBind,
        ModeNodeBind, MovingAverageNodeBind, PercentileNodeBind, SampleNodeBind, ShiftNodeBind, SideloadNodeBind, SpreadNodeBind, StateCountNodeBind,
        StateDurationNodeBind, StatsNodeBind, StddevNodeBind, SumNodeBind, SwarmAutoscaleNodeBind, TopNodeBind, UnionNodeBind, WhereNodeBind, WindowNodeBind {
    private static final String name = "kapacitorLoopback";

    public KapacitorLoopbackNode() {
        super(new ArrayList<>(),new ArrayList<>(),name);
    }

    public KapacitorLoopbackNode database(String value){
        Database database = new Database(value);
        super.addMethod(database);
        return this;
    }

    public KapacitorLoopbackNode measurement(String value){
        Measurement measurement = new Measurement(value);
        super.addMethod(measurement);
        return this;
    }

    public KapacitorLoopbackNode quiet(){
        Quiet quiet = new Quiet();
        super.addMethod(quiet);
        return this;
    }

    public KapacitorLoopbackNode retentionPolicy(String value){
        RetentionPolicy retentionPolicy = new RetentionPolicy(value);
        super.addMethod(retentionPolicy);
        return this;
    }

    public KapacitorLoopbackNode tag(String key, String value){
        Tag tag = new Tag(key, value);
        super.addMethod(tag);
        return this;
    }
}